package com.db.chat.tests;



import java.io.*;
import java.net.Socket;

import static java.lang.Thread.sleep;

/**
 * Created by Student on 25.11.2014.
 */
public class SimpleTestClient {
    public static void main(String[] args) throws IOException, InterruptedException {
        Socket s = new Socket("localhost", 10002);
        DataOutputStream os = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));
        DataInputStream is = new DataInputStream(new BufferedInputStream(s.getInputStream()));
        os.writeUTF("/snd TEST");
        //os.writeUTF("/hist");
        os.flush();
        sleep(5000);
        while (is.available() > 0) {
            System.out.println(is.readUTF());
        }
    }
}
